home *** CD-ROM | disk | FTP | other *** search
/ Robotics & Artificial Int…3 (Professional Edition) / Robotics & Artificial Intelligence Tools 2003 (Professional Edition).iso / neural network tool and application / nsinstall.exe / data1.cab / DLLCust_Files / AXON / 2NDORDER.C next >
Encoding:
C/C++ Source or Header  |  2002-03-08  |  605 b   |  23 lines

  1. // Dynamic link library implementation of a second order neuron
  2.  
  3. #include "NSDLL.h" 
  4.  
  5. /***********************************/
  6. /* Forward activation of component */
  7.  
  8. __declspec(dllexport) void performAxon(
  9.     DLLData    *instance,    // Pointer to instance data
  10.     NSFloat    *data,         // Pointer to the layer of processing elements (PEs)
  11.     int     rows,        // Number of rows of PEs in the layer
  12.     int     cols        // Number of columns of PEs in the layer
  13.     )
  14. {
  15.     int i, length=rows*cols;
  16.     NSFloat lastData=data[length-1];
  17.  
  18.     for (i=length-1; i>0; i--) {
  19.         data[i] = lastData*data[i-1];
  20.         lastData = data[i-1];
  21.     }
  22. }
  23.